import { defineConfig, loadEnv } from 'vite'
import alias from './vite/alias'
import { paresEnv } from './vite/utils'
import setupPlugins from './vite/plugins/index'

export default defineConfig(({ command, mode }) => {
   console.log(command)
   const root = process.cwd()
   const env = paresEnv(loadEnv(mode, root))
   return {
      plugins: setupPlugins(command, env),
      resolve: {
         alias
      }
   }
})
